<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<h:css href="/css/style1/style-custom.css"/>
<%--
- Author(s): pengweiling
- Date: 2012-07-22 13:12:04
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      客户留言录入
    </title>
  </head>
  <body>
    <e:datasource name="weguesmessage" type="entity" path="com.hms.OrderMgr.order.WeGuesmessage" />
    <h:form name="data_form" action="com.hms.OrderMgr.WeGuesmessageMaintain.flow" method="post" onsubmit="return checkForm(this);">
      <h:hidden property="weguesmessage/imsgid" />
      <l:equal property="_eosLastAccessAction" targetValue="update">
        <input type="hidden" name="_eosFlowAction" value="updateSubmit" >
      </l:equal>
      <l:equal property="_eosLastAccessAction" targetValue="insert">
        <input type="hidden" name="_eosFlowAction" value="insertSubmit" >
      </l:equal>
      <h:hiddendata property="criteria" />
      <h:hidden property="page/begin"/>
      <h:hidden property="page/length"/>
      <h:hidden property="page/isCount"/>
      <dataform id= "393ca042-fbe2-49b4-a4cf-d2a25e2331fd">
          <table align="center" border="0" width="100%" class="form_table">
            <h:hidden property="weguestmsgv/dreadedbusinessdate"/>            
            <h:hidden property="weguestmsgv/imsgid"/>
            <h:hidden property="actionName" value="NORMAL"/>            
            <tr>
              <td class="form_label">
                留言人
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="weguestmsgv/cvisitor" style="width:256px;" validateAttr="allowNull=false"/><font color="red">*</font>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="weguestmsgv/cvisitor" style="width:256px;" readonly="true"/>
                </l:notEqual>                                
              </td>
            </tr>
            <tr>
              <td class="form_label">
                客单
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <w:lookup property="weguestmsgv/igresid"  
                            style="width:256px;" 
                            dialogTitle="选择客单和房间"
                            displayProperty="weguestmsgv/cgresno"
                            lookupUrl="com.hms.commonPick.WeOrdersVSelect.flow"
                            onReturnFunc="setOthers"
                            height="400"
                            allowInput="false"
                            validateAttr="allowNull=false"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="weguestmsgv/cgresno" style="width:256px;" readonly="true"/>
                </l:notEqual>   
              </td>
            </tr>
            <tr>
              <td class="form_label">
                房号
              </td>
              <td colspan="1">
                <h:text property="weguestmsgv/croomno" readonly="true"  style="width:256px;" readonly="true"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                客人姓名
              </td>
              <td colspan="1">
                <h:text property="weguestmsgv/cguestname" readonly="true"  style="width:256px;" readonly="true"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                留言内容
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <h:textarea property="weguestmsgv/cmessage"  style="width:100%" validateAttr="allowNull=false"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:textarea property="weguestmsgv/cmessage"  style="width:100%" readonly="true"/>
                </l:notEqual>                       
                
              </td>
            </tr>
            <tr>
              <td class="form_label">
                状态
              </td>
              <td colspan="1">
                <h:select disabled="true" property="weguestmsgv/cstate"  style="width:256px;color:blue">
                  <option value="N">未读</option>
                  <option value="F">已读</option>
                  <option value="C">取消</option>  
                </h:select>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                创建人
              </td>
              <td colspan="1">
                <h:text property="weguestmsgv/createdname" readonly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                创建日期
              </td>
              <td colspan="1">
                <w:date property="weguestmsgv/dcreated" readOnly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                读取人
              </td>
              <td colspan="1">
                <h:text property="weguestmsgv/readname" readonly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                读取日期
              </td>
              <td colspan="1">
                <w:date property="weguestmsgv/dreaded" readOnly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr class="form_bottom">
              <td colspan="2">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                   <input type="submit" value="保存" class="button">
                </l:equal>
                
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <l:equal property="weguestmsgv/cstate" targetValue="N">
                     <input type="button" value="读取" class="button" onclick="readmsg()">
                     <input type="button" value="取消" class="button"  onclick="cancelmsg()">
                  </l:equal>
                </l:notEqual>
                <input type="button" value="返回" onclick="window.location.href='com.hms.OrderMgr.WeGuesmessageMaintain.flow';" class="button">
              </td>
            </tr>
          </table>
      </dataform>
    </h:form>
    
    <script>
      function readmsg(){
        $name("actionName").value = "READ";
        $name("data_form").submit()
      }
      
      function cancelmsg(){
        $name("actionName").value = "CANCEL";
        $name("data_form").submit()
      }
            
      function setOthers(args){
         if (args){
            $name("weguestmsgv/croomno").value = args[3];
            $name("weguestmsgv/cguestname").value = args[4];
         }else{
            $name("weguestmsgv/croomno").value = "";
            $name("weguestmsgv/cguestname").value = "";
         }
         return true;
      }
    </script>
  </body>
</html>
